<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>:: Welcome to CCMS ::</title>
<?php 

	/*echo link_css('style.css?v=' . time());
	echo link_css('ui-lightness/jquery-ui-1.9.2.custom.css');
	echo link_css('multi-select.css');
	echo link_js('jquery-1.8.3.js');
	echo link_js('jquery-ui-1.9.2.custom.js');
	echo link_js('jquery.multi-select.js');
	echo link_js('jquery.maskedinput.js');
	echo link_js('common.js');*/

	echo link_css('style.css?v=' . time());
	echo link_css('multi-select.css?v=' . time());
	echo link_css('themes/base/jquery.ui.all.css?v=' . time());
	echo link_js('jquery-1.8.3.js');
	echo link_js('jquery-ui-1.9.2.custom.js');
	echo link_js('jquery.multi-select.js');
	echo link_js('jquery.maskedinput.js');
	echo link_js('ui/jquery.ui.core.js');
	echo link_js('ui/jquery.ui.datepicker.js');
	echo link_js('jquery.ui.timepicker.js?v=0.3.2');
	//echo link_js('jquery-ui-timepicker-addon.js'); another compatible time/datetime picker
	echo link_js('common.js');
	
?>
</head>
<script type="text/javascript">
	var base_url = '<?php echo base_url(); ?>';
</script>
<body>
<div class="logoDiv">
  <div class="FloatLeft"><a href="<?php echo base_url(); ?>"><img src="<?php echo imageUrl(); ?>logo.jpg" width="242" height="65" alt="" /></a></div>
  <div class="topNavBtns">
    <ul>
      <li>
        <div class="dashboard_link"><a href="<?php echo base_url_2(); ?>realtime">Dashboard</a></div>
      </li>
      
      <!--<li>
        <div class="setting_link"><a href="#">Settings</a></div>
      </li>
      <li>
        <div class="reports_link"><a href="#">Reports</a></div>
      </li>-->
      <li  class="LISelected">
        <div class="client_link"><a href="#">Call Center</a></div>
      </li>
      <li>
         <div class="reports_link"><a href="<?php echo base_url_2(); ?>realtime/reports.php">Reports</a></div>
       </li>
     <!-- <li>
        <div class="recordings_link"><a href="#">Recordings</a></div>
      </li>
      <li>
        <div class="upload_link"><a href="#">Upload</a></div>
      </li>-->
    </ul>
  </div>
</div>

<?php 
	$user_type = $this->session->userdata('sess_user_type');
	$user_id = $this->session->userdata('sess_user_id');
	
	$username = '';
	
	if( $user_type == 'admin' ) {
		$login_str = 'Logged in as <strong>admin</strong>';
	}
	else
	{
		$full_name = $this->session->userdata('sess_admin_name');	
		if( $full_name != '' )
		{
			$login_str = "<strong>".$full_name . "</strong> Logged in ";	
		}
		else
		{
			$login_str = "<strong>".$this->session->userdata('sess_username') . "</strong> Logged in ";	
		}
		
	}
	
			
?>

<div class="userStatus">
  <div class="userStatusInner">
    <div class="FloatLeft"><img src="<?php echo imageUrl(); ?>login_userIcon.png" alt="" width="26" height="29" /></div>
    <div class="loginUserStatus"><?php echo $login_str; ?> &nbsp;l&nbsp; <a href="<?php echo base_url();?>logout">Logout</a></div>
  </div>
</div>

<?php 


?>



<div class="midContent"> 
<div class="menu">
  <ul>
  <li> <a href="<?php echo base_url();?>main" <?php echo ($this->uri->segment(1) == '' ||  $this->uri->segment(1)  == 'main' ) ? 'style="color: #fff;background-color:#080808;"' : '' ?> >Home</a> </li>
  <?php 

	$module_arr = getUserModules($this->session->userdata('sess_user_id'));
	
	foreach ( $module_arr as $menu) 
	{
		$active = '';
		if($this->uri->segment(1)  == $menu->url && $this->uri->segment(2) != 'batch_update')
		{
			$active = 'style="color: #fff;background-color:#080808;"';
		}
		elseif($this->uri->segment(1) == 'tfn' && $this->uri->segment(1)."/".$this->uri->segment(2) == $menu->url)
		{
			$active = 'style="color: #fff;background-color:#080808;"';
		}
		
	
		  
 ?>
    <li> <a href="<?php echo base_url().$menu->url;?>" <?php echo $active; ?> ><?php echo $menu->name;?></a> </li>
  <?php }  ?>
  </ul>
</div>
{yield}
  <div class="divFix"></div>
</div>
<div class="footer">Copyright &copy; <?php echo date('Y'); ?>. All Rights Reserved TRG World Pakistan.</div>
</body>
</html>
